//
//  ShenHeShiBaiViewController.m
//  FactorySale
//
//  Created by 李 on 2020/1/15.
//  Copyright © 2020 主事丫环. All rights reserved.
//

#import "ShenHeShiBaiViewController.h"
#import "XiuGaiXinXiViewController.h"

@interface ShenHeShiBaiViewController ()

@end

@implementation ShenHeShiBaiViewController
- (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:animated];

}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:animated];
}
- (void)viewDidLoad {
    [super viewDidLoad];
     self.view.backgroundColor = [UIColor whiteColor];
     [self configViews];
}
-(void)configViews
{
    UIImageView *backImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, ScreenW, 265)];
    backImageView.image = [UIImage imageNamed:@"审核失败"];
    [self.view addSubview:backImageView];
    
     UIButton *leftbutton = [[UIButton alloc] initWithFrame:CGRectMake(20, 35, 30, 30)];
          leftbutton.titleLabel.font = [UIFont systemFontOfSize:14];
          [leftbutton setContentEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 0)];
          [leftbutton setImage:imgname(@"leftWhiteBtn") forState:(UIControlStateNormal)];
          [leftbutton setTitleColor:KTEXTCOLOR forState:UIControlStateNormal];
          [leftbutton addTarget:self action:@selector(leftBtnClick) forControlEvents:UIControlEventTouchUpInside];
         [self.view addSubview:leftbutton];
    
    UILabel *titlelab = [[UILabel alloc]initWithFrame:CGRectMake((ScreenW-100)/2, 40, 100, 15)];
    titlelab.font = FontSize(15);
    titlelab.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
    titlelab.text = @"审核结果";
    titlelab.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:titlelab];
    
    UILabel *stateLab = [[UILabel alloc]init];
    stateLab.font = KFontPingFangSCMedium(16);
    stateLab.textColor = [UIColor colorWithHexString:@"#333333"];
    stateLab.text = @"抱歉，您的信息审核未通过！";
    stateLab.textAlignment = NSTextAlignmentCenter;
    stateLab.numberOfLines = 0;
    [self.view addSubview:stateLab];
    [stateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(backImageView.mas_bottom).mas_offset(20);
        make.left.equalTo(self.view.mas_left).mas_offset(15);
        make.right.equalTo(self.view.mas_right).mas_offset(-15);
        make.width.mas_greaterThanOrEqualTo(56);
        make.height.mas_greaterThanOrEqualTo(16);
    }];

    //提示
    UILabel *tipLab = [[UILabel alloc]init];
    tipLab.font = KFontPingFangSCMedium(13);
    tipLab.textColor = [UIColor colorWithHexString:@"#999999"];
    tipLab.text = self.resultDic[@"rejection_reason"];
    tipLab.textAlignment = NSTextAlignmentCenter;
    tipLab.numberOfLines = 0;
    [self.view addSubview:tipLab];
    [tipLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(stateLab.mas_bottom).mas_offset(10);
        make.left.equalTo(self.view.mas_left).mas_offset(15);
        make.right.equalTo(self.view.mas_right).mas_offset(-15);
        make.width.mas_greaterThanOrEqualTo(56);
        make.height.offset(40);
    }];
   
    
    UIButton *editButton = [[UIButton alloc] init];
     editButton.titleLabel.font = [UIFont systemFontOfSize:15];
     [editButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     [editButton addTarget:self action:@selector(editButtonClick) forControlEvents:UIControlEventTouchUpInside];
    editButton.layer.cornerRadius = 20;
    editButton.clipsToBounds = YES;
    editButton.backgroundColor = [UIColor colorWithHexString:@"#FFB93F"];
    [editButton setTitle:@"修改信息" forState:UIControlStateNormal];
    [self.view addSubview:editButton];
    [editButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(tipLab.mas_bottom).mas_offset(34);
        make.left.equalTo(self.view.mas_left).mas_offset(60);
        make.right.equalTo(self.view.mas_right).mas_offset(-60);
        make.width.mas_greaterThanOrEqualTo(56);
        make.height.mas_equalTo(40);
    }];
  
    
   
}
-(void)leftBtnClick
{
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)editButtonClick
{
    XiuGaiXinXiViewController *vc = [[XiuGaiXinXiViewController alloc]init];
    vc.resultDic = self.resultDic;
    [self.navigationController pushViewController:vc animated:YES];
}

@end
